package com.kun.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kun.entity.SysFileStorage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author kun.li
 */
@Mapper
public interface FileStorageMapper  extends BaseMapper<SysFileStorage> {


    @Select("SELECT concat(t1.storage_absolute_directory,t2.storage_directory) as storage_directory  FROM sys_file_storage t1 \n" +
            "join sys_file_storage t2\n" +
            "on t1.storage_id=t2.storage_parent_id where  t2.storage_id=#{storageId}")
    String getStorageDirectory(@Param("storageId") String storageId);
}
